package com.ruoyi.common.exception.base.manipulation;

import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;

/**
 * @Classname UpdateDataException
 * @Author: sunluquan
 * @Date: 2022/5/9 15:39
 * @Description TODO
 * 修改数据
 */
public class UpdateDataException extends BaseDataManipulationException {

    public UpdateDataException(String module, String code, Object[] args, String defaultMessage) {
        super(StringUtils.isEmpty(module)?"data manipulation of update":module, code, args, defaultMessage);
    }

    public UpdateDataException(String module, String code, Object[] args) {
        this(module, code, args ,null);
    }

    public UpdateDataException(String module, String defaultMessage) {
        this(module , null ,null , defaultMessage);
    }

    public UpdateDataException(String code, Object[] args) {
        this(null,code, args,null);
    }

    public UpdateDataException(String defaultMessage) {
        this(null,null,null,defaultMessage);
    }

    public UpdateDataException() {
        this("修改失败！");
    }
    /**
     * @Classname CanNotUpdateStateToDisableException
     * @Author: sunluquan
     * @Date: 2022/5/19 09:47
     * @Description TODO
     * 不能修改bean 状态数据为禁用
     */
    public static class CanNotUpdateStateToDisableException extends UpdateDataException {

        public CanNotUpdateStateToDisableException(String module, String code, Object[] args, String defaultMessage) {
            super(module, code, args, defaultMessage);
        }

        public CanNotUpdateStateToDisableException(String module, String code, Object[] args) {
            this(module, code, args ,null);
        }

        public CanNotUpdateStateToDisableException(String module, String defaultMessage) {
            this(module , null ,null , defaultMessage);
        }

        public CanNotUpdateStateToDisableException(String code, Object[] args) {
            this(null,code, args,null);
        }

        public CanNotUpdateStateToDisableException(String defaultMessage) {
            this(null,null,null,defaultMessage);
        }

    }
}
